<%@ page language="java" import="java.util.*,java.sql.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>个人设置页面</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

</head>
<body>
<%
try{
Class.forName("com.mysql.jdbc.Driver");
String url="jdbc:mysql://localhost:3306/middletest?useUnicode=ture&characterEncoding=UTF8";
Connection conn = DriverManager.getConnection(url, "root", "123");
String sql = "select * from post";

PreparedStatement ps = conn.prepareStatement(sql);
ResultSet rs = ps.executeQuery();
%>
<form action="#">
<table border="1px" width="666px" height="500px" align="center" cellpadding="0px" cellspacing="0px" bgcolor="white">
<tr bgcolor="#00ced1">
    <td width="150px" height="100px">

    </td>
    <td >
        用户：
    </td>
    <td align="center">
        <input  type="button" value="发帖" id="fatie" style="width: 80px;height: 40px;background-color: #b3d4fc">
    </td>
    <td align="center">
        <input type="button" value="重置密码" id="reset" style="width: 80px;height: 40px;background-color: #b3d4fc">
    </td>
    <td align="center">
        <input type="button" value="注销" id="zhuxiao" style="width: 80px;height: 40px;background-color: #b3d4fc">
    </td>
</tr>
    <tr>
        <td align="center" height="50px">
            板块
        </td>
        <td colspan="4" rowspan="2">
            <table border="1px" width="400px" height="300px" align="center" cellpadding="0px" cellspacing="0px" bgcolor="#deb887">
                <tr bgcolor="#00ced1">
                    <td width="200px" height="30px">
                        帖子内容
                    </td>
                    <td width="80px">
                        发帖人
                    </td>
                    <td>
                        最后修改时间
                    </td>
                </tr>
                <%
                while(rs.next()){
                %>
                <tr bgcolor="white">
                    <td width="200px" height="50px">
                       <%
                       out.print(rs.getString(2));
                       %>
                    </td>
                    <td>
						<%
                       out.print(rs.getString(3));
                       %>
                    </td>
                    <td>
						<%
                       out.print(rs.getString(4));
                       %>
                    </td>
                </tr>
               <%
                }
               %>
           
            </table>

        </td>

    </tr>
    <tr>
        <td>

        </td>


    </tr>
 <%
    rs.close();
    ps.close();
    conn.close();
}catch(Exception e){
	e.printStackTrace();
}
    %>
</table>
</form>

</body>
</html>
